package com.itheima02.day01test;

/**
 * @author 刘全
 * @date 2021/7/15
 */
public class Test {
    public static void main(String[] args) {
        /*请根据上述类的设计，抽取父类“电器类” Electrical
        并代码实现父类“电器类”、子类“冰箱类”，“洗衣机类”、“电视类”
        二:在测试类,分别创建 冰箱类 洗衣机 电视类,通过set
        方法为每个对象的成员变量赋值,且调用成员方法*/
        Freezer f = new Freezer();
        f.setBrand("1");
        f.setXinhao("2");
        f.setColor("3");
        f.setPrice(4);
        System.out.println(f.getBrand() + "\t" + f.getXinhao() + "\t" + f.getColor() + "\t" + f.getPrice());
        f = new Freezer("海尔兄弟", "2010", "白色", 2999);
        System.out.println(f.getBrand() + "\t" + f.getXinhao() + "\t" + f.getColor() + "\t" + f.getPrice());
        f.storage();
        Washer w = new Washer();
        w.setBrand("2");
        w.setXinhao("3");
        w.setColor("4");
        w.setPrice(5);
        System.out.println(w.getBrand() + "\t" + w.getXinhao() + "\t" + w.getColor() + "\t" + w.getPrice());
        w = new Washer("格力", "2020", "银色", 1888);
        System.out.println(w.getBrand() + "\t" + w.getXinhao() + "\t" + w.getColor() + "\t" + w.getPrice());
        w.doSomeWashing();
        TV tv = new TV();
        tv.setBrand("3");
        tv.setXinhao("4");
        tv.setColor("5");
        tv.setPrice(6);
        System.out.println(tv.getBrand() + "\t" + tv.getXinhao() + "\t" + tv.getColor() + "\t" + tv.getPrice());
        tv = new TV("步步高", "2019", "黑色", 3999);
        System.out.println(tv.getBrand() + "\t" + tv.getXinhao() + "\t" + tv.getColor() + "\t" + tv.getPrice());
        tv.seeSmallPieces();
        System.out.println("-------华丽的分割线-------");
        /*请根据需求，设计、并编码实现：父类“人员类”，子类“教练员类”、子类“运动员类”，
        并包含共有的属性和行为的定义，由于运动员和教练员的吃饭的内容不同，所以需要设计为“抽象方法”。*/
        Player p = new Player("2", "憨丕", "男", 24);
        System.out.println(p.getId() + "\t" + p.getName() + "\t" + p.getSex() + "\t" + p.getAge());
        p.eat();
        Teach t = new Teach("666", "刘", "男", 22);
        System.out.println(t.getId() + "\t" + t.getName() + "\t" + t.getSex() + "\t" + t.getAge());
        t.eat();
        System.out.println("-------华丽的分割线-------");
        //请按需求为这两个类定义一个父类，并使用“模板”发布通知。
        Coder c = new Coder("001", "憨丕", "已经入土");
        System.out.println(c.getId() + "\t" + c.getName() + "\t" + c.getAge());
        c.message();
        Manager m = new Manager("666", "刘大哥", "风华正茂");
        System.out.println(m.getId() + "\t" + m.getName() + "\t" + m.getAge());
        m.message();
    }
}
